package com.ruoyi.system.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.enums.RestaurantOrderStatusEnum;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

import java.util.List;


/**
 * 餐饮订单对象 restaurant_order
 * 
 * @author 强盛酒店
 * @date 2023-03-12
 */
public class RestaurantOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 餐饮订单id */
    private Long id;

    /** 预订人姓名 */
    @Excel(name = "预订人姓名")
    private String userName;

    /** 身份证号码 */
    @Excel(name = "身份证号码")
    private String idCard;

    /** 联系方式 */
    @Excel(name = "联系方式")
    private String phone;

    /** 订单价格 */
    @Excel(name = "订单价格")
    private String orderPrice;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private Integer status;

    @Transient
    private String statusName;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long createUser;

    /** 修改人 */
    @Excel(name = "修改人")
    private Long updateUser;

    /** 是否已删除 */
    @Excel(name = "是否已删除")
    private Integer isDeleted;

    @Transient
    private String res;

    @Transient
    private List<RestaurantOrderItem> restaurantOrderItems;

    public List<RestaurantOrderItem> getRestaurantOrderItems() {
        return restaurantOrderItems;
    }

    public void setRestaurantOrderItems(List<RestaurantOrderItem> restaurantOrderItems) {
        this.restaurantOrderItems = restaurantOrderItems;
    }

    public String getRes() {
        return res;
    }

    public void setRes(String res) {
        this.res = res;
    }

    public String getStatusName() throws Exception{
        if (status!=null){
            statusName = RestaurantOrderStatusEnum.getEnum(status).getName();
        }
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    public String getUserName() 
    {
        return userName;
    }
    public void setIdCard(String idCard) 
    {
        this.idCard = idCard;
    }

    public String getIdCard() 
    {
        return idCard;
    }
    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    public String getPhone() 
    {
        return phone;
    }
    public void setOrderPrice(String orderPrice) 
    {
        this.orderPrice = orderPrice;
    }

    public String getOrderPrice() 
    {
        return orderPrice;
    }
    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }
    public void setCreateUser(Long createUser) 
    {
        this.createUser = createUser;
    }

    public Long getCreateUser() 
    {
        return createUser;
    }
    public void setUpdateUser(Long updateUser) 
    {
        this.updateUser = updateUser;
    }

    public Long getUpdateUser() 
    {
        return updateUser;
    }
    public void setIsDeleted(Integer isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() 
    {
        return isDeleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userName", getUserName())
            .append("idCard", getIdCard())
            .append("phone", getPhone())
            .append("orderPrice", getOrderPrice())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("createUser", getCreateUser())
            .append("updateTime", getUpdateTime())
            .append("updateUser", getUpdateUser())
            .append("isDeleted", getIsDeleted())
            .toString();
    }
}
